<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>执法对象库管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$(".select-result_ ul").delegate("li","click", function(){
				var type = $(this).attr("date-type");
				$(this).remove();
				$("#select2_ li[date-type='" + type + "']").removeClass("selected_");
			});		
			$("#select2_ li").click(function() {
				var type = $(this).attr("date-type");
				var copyThisB = $(this).clone();
				if ($(this).hasClass("selected_")) {
					$(".select-result_ li[date-type='" + type + "']").remove();
				} else {
					$(".select-result_ ul").append(copyThisB);
				};
				$(this).toggleClass("selected_");
			});	
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/jcxx/drJcxx/jhform?id=${drJcxx.id}">法定事项</a></li>
        <li class="active"><a href="${ctx}/jcxx/drJcxx/jhform_zdy?id=${drJcxx.id}">自定义事项</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="drJcxx" action="${ctx}/jcxx/drJcxx/zfryk" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		        	        	
		<div class="control-group">
			<label class="control-label">名称：</label>
			<div class="controls">
				<form:input path="jhmc" htmlEscape="false" maxlength="255" class="input-xlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">制定单位：</label>
			<div class="controls">
				<form:input path="office.id" htmlEscape="false" maxlength="64" class="input-xlarge " value="天津局" disabled="true"/>
			</div>
		</div>        
		<div class="control-group">
			<label class="control-label">管理单位：</label>
			<div class="controls">
				<sys:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name" labelValue="${user.office.name}" 
				title="管理单位" url="/sys/office/treeData?type=2" cssClass="input-xlarge" allowClear="true" notAllowSelectParent="false"/>
			</div>
		</div>          
		<div class="control-group">
			<label class="control-label">所需专业：</label>
			<div class="controls">
            	
                <div class="sousuo clearfix">
                	<div style="float:left;width:50px;"><font color="black">选择专业</font> </div>
                    <div class="select-result_ clearfix" style="float:right">
                        
                        <ul>
                        </ul>
                        
                    </div>
                </div>       
                <div class="updown_box">
                    <ul id="select2_">
                        <c:forEach items="${fns:getDictList('sys_user_zy')}" varStatus="i" var="dic">                      
                        <li date-type="${dic.value}"><a href="javascript:;">${dic.label}</a></li>                             
                        </c:forEach>                      

                    </ul>
                </div>            
<!--				<form:select path="wtms" class="input-xlarge" multiple="true">
					<form:options items="${fns:getDictList('sys_user_zy')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>    -->
<!--				 <div class="topnav">

					<a id="selectpos" href="javascript:void(0);" class="as">
						<span>选择职位</span>			
					</a>								
				</div>-->
                <input type="hidden" value="" id="selectposhidden" />	                                      
			</div>
		</div>           
		<div class="control-group">
			<label class="control-label">备注：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="jcxx:drJcxx:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="下一步，配置执法人员库"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onClick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>